Interface IEqualityComparer<T>

The type of an item equalityComparer. Implementations of this interface must assure that the methods are consistent, that is, that whenever two items i1 and i2 satisfies that Equals(i1,i2) returns true, then GetHashCode returns the same value for i1 and i2.Implementations of this interface must assure that repeated calls of the methods to the same (in reference or binary identity sense) arguments will return the same values, or state precise conditions under which the user can be assured repeated calls will return the same values.Implementations of this interface must always return values from the methods and never throw exceptions.This interface is similar in function to System.IKeyComparer<T>

Implemented by

ByteEqualityComparer, CharEqualityComparer, ComparerZeroHashCodeEqualityComparer<T>, DoubleEqualityComparer, EquatableEqualityComparer<T>, IntEqualityComparer, KeyValuePairEqualityComparer<K,V>, NaturalEqualityComparer<T>, ReferenceEqualityComparer<T>, SequencedCollectionEqualityComparer<T,W>, UnsequencedCollectionEqualityComparer<T,W>

Method overview

Equals(T item1, T item2),
GetHashCode(T item)

Method details

AboolEquals(T item1, T item2) Check if two items are equal with respect to this item equalityComparer
Returns:True if equal
Parameters:
item1:first item
item2:second item
AintGetHashCode(T item) Get the hash code with respect to this item equalityComparer
Returns:The hash code
Parameters:
item:The item